package com.ithuameng.admin.exception;

import com.ithuameng.admin.enums.BaseError;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class AdminException extends RuntimeException {

    private static final long serialVersionUID = 7816116583828923211L;

    private BaseError baseError;

    public AdminException() {
        super();
    }

    public AdminException(BaseError baseError) {
        super(baseError.getDesc());
        this.baseError = baseError;
    }

    public AdminException(BaseError baseError, String message) {
        super(message);
        this.baseError = baseError;
    }

    public AdminException(String message, Throwable cause) {
        super(message, cause);
    }

    public AdminException(String message) {
        super(message);
    }

    public AdminException(Throwable cause) {
        super(cause);
    }
}
